<template>
  <div style="height:100%">
    <el-container style="height: 100vh">
      <el-aside :width="sideWidth+'px'"
                style="background-color: #fff; box-shadow:2px 0 6px rgba(0 ,21, 41, 0.35);height:100%;overflow-x: hidden">
        <Aside :isCollapse="isCollapse" :logoTextShow="logoTextShow"/>
      </el-aside>

      <el-container>
        <el-header style="border-bottom: 1px solid #ccc">
          <Header :collapseBtnClass="collapseBtnClass" :collapse="collapse"/>
        </el-header>

        <el-main>
          <!--          表示当前页面的子路由会在router-view中展示-->
          <router-view/>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
// @ is an alias to /src
import HelloWorld from '@/components/HelloWorld.vue'
import Aside from "@/components/Aside";
import Header from "@/components/Header";
//import request from "@/utils/request";用this访问request

export default {
  name: 'Manage',

  data() {

    return {

      collapseBtnClass: 'el-icon-s-fold',
      isCollapse: false,
      logoTextShow: true,

      sideWidth: 200
    }
  },

  components: {
    Aside,
    Header
  },

  methods: {
    collapse() {//点击收缩按钮触发
      this.isCollapse = !this.isCollapse
      if (this.isCollapse) {//收缩
        this.sideWidth = 64
        this.collapseBtnClass = 'el-icon-s-unfold'
        this.logoTextShow = false;
      } else {//展开
        this.sideWidth = 200
        this.collapseBtnClass = 'el-icon-s-fold'
        this.logoTextShow = true;
      }
    }
  }
}


</script>
